package cn.kgc.itrip.controller;



import cn.kgc.itrip.dto.Dto;
import cn.kgc.itrip.service.hotelService.HotelService;
import cn.kgc.itrip.vo.ItripAreaDicVO;
import cn.kgc.itrip.vo.ItripImageVO;
import cn.kgc.itrip.vo.hotel.HotelVideoDescVO;
import cn.kgc.itrip.vo.hotel.ItripSearchFacilitiesHotelVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/hotel")
public class HotelController {

    @Resource
    private HotelService hotelService;


    /**
     * 查询热门城市
     * @param type
     * @return
     */
    @GetMapping(value = "/queryhotcity/{type}",consumes = "application/json",produces = "application/json")
    public Dto<ItripAreaDicVO> queryhotcity(@PathVariable Integer type){
        Dto<ItripAreaDicVO> dto=null;
        dto=hotelService.findQueryHotCity(type);
        return dto;
    }

    /**
     * 查询商圈
     * @param cityId
     * @return
     */
    @GetMapping(value = "/querytradearea/{cityId}",consumes = "application/json",produces = "application/json")
    public Dto<ItripAreaDicVO> queryTradeArea(@PathVariable Integer cityId){
        Dto<ItripAreaDicVO> dto=null;
        dto=hotelService.findTradeArea(cityId);
        return dto;
    }

    /**
     * 根据targetId查询酒店图片(type=0)
     * @param targetId
     * @return
     */
    @GetMapping(value = "/getimg/{targetId}",consumes = "application/json",produces = "application/json")
    public Dto<ItripImageVO> getImg(@PathVariable String targetId){
        Dto<ItripImageVO> dto=null;
        dto=hotelService.findImgAddress(targetId);
        return dto;
    }

    /**
     * 根据酒店id查询酒店特色、商圈、酒店名称
     * @param hotelId
     * @return
     */
    @GetMapping(value = "/getvideodesc/{hotelId}",consumes = "application/json",produces = "application/json")
    public Dto<HotelVideoDescVO> getVideoDesc(@PathVariable String hotelId){
        Dto<HotelVideoDescVO> dto=null;
        dto=hotelService.findVideoDesc(hotelId);
        return dto;
    }

    /**
     * 根据酒店id查询酒店设施
     * @param id
     * @return
     */
    @GetMapping(value = "/queryhotelfacilities/{id}",consumes = "application/json",produces = "application/json")
    public Dto<ItripSearchFacilitiesHotelVO> hotelFacilities(@PathVariable Integer id){
        Dto<ItripSearchFacilitiesHotelVO> dto=null;
        dto=hotelService.findFacilitiesHotelVO(id);
        return dto;
    }

    /**
     * 查询酒店特色列表
     * @return
     */
    @GetMapping(value = "/queryhotelfeature",produces = "application/json")
    public Dto queryHotelFeature(){
        Dto dto=null;
        dto=hotelService.fiindHotelFeature();
        return dto;
    }

    /**
     * 根据酒店id查询酒店特色和介绍
     * @param id
     * @return
     */
    @GetMapping(value = "/queryhoteldetails/{id}",consumes ="application/json",produces = "application/json")
    public Dto queryHotelDetails(@PathVariable Integer id){
        Dto dto=null;
        dto=hotelService.findHotelDetails(id);
        return dto;
    }

    /**
     * 根据酒店id查询酒店政策
     * @param id
     * @return
     */
    @GetMapping(value = "/queryhotelpolicy/{id}",consumes ="application/json",produces = "application/json")
    public Dto queryhotelpolicy(@PathVariable Integer id){
        Dto dto=null;
        dto=hotelService.findHotelPolicy(id);
        return dto;
    }
}
